package sorts

// 冒泡排序
type BubbleSort struct {
}

func (bs *BubbleSort) do(dest *[]int) {
	val := *dest
	size := len(val)
	for i := 0; i < size; i++ {
		for j := i + 1; j < size; j++ {
			if val[j-1] > val[j] {
				tmp := val[j-1]
				val[j-1] = val[j]
				val[j] = tmp
			}
		}
	}
}
